<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var phone={
            name:'华为手机',
            price:1000,
            makeCall:function(){
                console.log('接电话');

            }
        }
        console.log(phone.name);
        console.log(phone['name']);
        phone.makeCall();
        phone['answerPhone']();

        function Animal(name,age){
            this.name=name;
            this.age=age;
            this.shaw=function(){
                console.log(this.name,this.age,"动物");
            }
        }
        var animal = new Animal('猴子',5);
        console.log(animal.name,animal.age);
        animal.show();

        Animal.prototype=phone;
        var animal2 = new Animal('大象',10);
    </script>
</body>
</html>